package com.zyh.work2

import scala.io.StdIn

object Box{
  def main(args: Array[String]): Unit = {
    println("输入长：")
    val length: Double = StdIn.readDouble()
    println("输入宽：")
    val weight: Double = StdIn.readDouble()
    println("输入高：")
    val high: Double = StdIn.readDouble()
    val box: Box = Box(length,weight,high)
    println(s"volumn = ${box.volumn}")
  }
}
case class Box(length:Double,weight:Double,high:Double){
  def volumn: Double = length*weight*high
}
